package cn.wostore.wxhelper;

import cn.wostore.wxhelper.Xposed.LoadHook;
import cn.wostore.wxhelper.bean.PackageNameInfo;
import de.robv.android.xposed.IXposedHookLoadPackage;
import de.robv.android.xposed.callbacks.XC_LoadPackage;

/**
 * @author wuch
 * @date 2018/12/17 0017
 */
public class XposedInit implements IXposedHookLoadPackage {
    private PackageNameInfo info = new PackageNameInfo();

    @Override
    public void handleLoadPackage(XC_LoadPackage.LoadPackageParam lpparam) throws Throwable {
        LoadHook loadHook = new LoadHook(lpparam.classLoader);
        if (lpparam.packageName.equals(info.WECHAT_PROCESS_NAME)) {
            loadHook.mainLoad(lpparam.classLoader);
        }
    }
}
